/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pqno;


import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;

/**
 *
 * @author wida46984148
 */
public class DownEnemy extends Component {

    float direction;
    float speed;
    boolean pause = true;

    public DownEnemy(String id) {
        this.id = id;
    }

    public float getSpeed() {
        return speed;
    }

    public float getDirection() {
        return direction;
    }

    @Override
    public void update(GameContainer gc, StateBasedGame sb, int delta) {

        float rotation = owner.getRotation();
        float scale = owner.getScale();
        Vector2f position = owner.getPosition();

        Input input = gc.getInput();

        
        float hip = 0.4f * delta;
        float auxY = position.y;
        position.x += hip * java.lang.Math.sin(java.lang.Math.toRadians(rotation));
        position.y += hip * java.lang.Math.cos(java.lang.Math.toRadians(rotation));
        if (700 <= position.y){
            position.y = auxY;
        }

        owner.setPosition(position);
        owner.setRotation(rotation);
        owner.setScale(scale);
    }
}
